package com.example.demo.utils;

import java.util.Arrays;

public class CheckUtil {
    private static final String token = "kejiehan";
    public static boolean checkSignature(String signature,String timestamp,String nonce){
        String[] arr = new String[]{token,timestamp,nonce};
        Arrays.sort(arr);
        StringBuffer stringBuffer = new StringBuffer();
        for (String s : arr) {
            stringBuffer.append(s);
        }
        String temp = SHA1.encode(stringBuffer.toString());
        return temp.equals(signature);
    }
}
